package cn.jlearn.proxy.web.convert;

import cn.jlearn.proxy.web.model.Tunnel;
import cn.jlearn.proxy.web.vo.TunnelInfoVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @author qianyingchao
 * @version 1.0
 * @date 2021/7/15 2:29 下午
 */
@Mapper(componentModel = "spring")
public interface TunnelConvert {

    @Mappings({
            @Mapping(source = "name", target = "tunnelName"),
            @Mapping(source = "localHost", target = "targetHost"),
            @Mapping(source = "localPort", target = "targetPort"),
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    })
    TunnelInfoVO toTunnelInfoVO(Tunnel tunnel);

}
